<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>

<body>
    <div id="app">
        <select v-model="cityList">
            <option value="">请选择省份</option>
            <option :value="item.list" v-for="item  in list">{{item.name}}</option>
        </select>
        <select v-model="townList">
            <option value="">请选择城市</option>
            <option :value="item.list" v-for="item in cityList">
                {{item.name}}
            </option>
        </select>
        <select>
            <option value="">请选择区县</option>
            <option v-for="item in townList">
                {{item.name}}
            </option>
        </select>
    </div>
</body>
<script>
    new Vue({
        el: "#app",
        data: {
            cityList: "",//城市的集合
            townList: "",//区县的集合
            list: [{ id: 1, name: "湖北", list: [{ id: 11, name: "武汉", list: [{ id: 111, name: "江夏" }, { id: 112, name: "洪山" }] }, { id: 12, name: "荆州", list: [{ id: 121, name: "沙市" }, { id: 122, name: "松滋" }] }] }, { id: 2, name: "河南", list: [{ id: 21, name: "郑州", list: [{ id: 211, name: "新郑" }, { id: 212, name: "紫金" }] }, { id: 22, name: "洛阳", list: [{ id: 221, name: "洛阳的区一" }, { id: 222, name: "洛阳的区二" }] }] }]
        },
        watch: {
            cityList() {//省份发生改变
                this.townList = "";

            }
        }
    })

</script>

</html>